home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 May: Tool Chest / Dev.CD May 00 TC.toast / pc / tool chest / macapp / macapp r14d5 / install macapp r14d5 / Apple Frameworks / WASTE / Source / WEAccessors.c next >
MacBinary  |  2000-02-25  |  7.6 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Fri Feb 25 05:00:00 2000, modified Fri Feb 25 05:00:00 2000, creator 'CWIE', type ASCII, 7263 bytes "WEAccessors.c" , at 0x1cdf 286 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 57 45 41 63 63 65 | 73 73 6f 72 73 2e 63 00 |..WEAcce|ssors.c.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 1c 5f 00 | 00 01 1e b4 dc 03 20 b4 |......_.|...... .|
|00000060| dc 03 20 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.. .....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 ff 47 00 00 |........|.....G..|
|00000080| 2f 2a 0d 20 2a 09 57 45 | 41 63 63 65 73 73 6f 72 |/*. *.WE|Accessor|
|00000090| 73 2e 63 0d 20 2a 0d 20 | 2a 09 57 41 53 54 45 20 |s.c. *. |*.WASTE |
|000000a0| 50 52 4f 4a 45 43 54 0d | 20 2a 20 20 41 63 63 65 |PROJECT.| * Acce|
|000000b0| 73 73 6f 72 73 0d 20 2a | 0d 20 2a 20 20 43 6f 70 |ssors. *|. * Cop|
|000000c0| 79 72 69 67 68 74 20 28 | 63 29 20 31 39 39 33 2d |yright (|c) 1993-|
|000000d0| 31 39 39 38 20 4d 61 72 | 63 6f 20 50 69 6f 76 61 |1998 Mar|co Piova|
|000000e0| 6e 65 6c 6c 69 0d 20 2a | 09 41 6c 6c 20 52 69 67 |nelli. *|.All Rig|
|000000f0| 68 74 73 20 52 65 73 65 | 72 76 65 64 0d 20 2a 0d |hts Rese|rved. *.|
|00000100| 20 2a 20 20 43 20 70 6f | 72 74 20 62 79 20 44 61 | * C po|rt by Da|
|00000110| 6e 20 43 72 65 76 69 65 | 72 0d 20 2a 0d 20 2a 2f |n Crevie|r. *. */|
|00000120| 0d 0d 2f 2a 0d 09 50 6f | 72 74 69 6f 6e 73 20 63 |../*..Po|rtions c|
|00000130| 6f 70 79 72 69 67 68 74 | 20 a9 20 31 39 39 38 2d |opyright| . 1998-|
|00000140| 31 39 39 39 20 62 79 20 | 41 70 70 6c 65 20 43 6f |1999 by |Apple Co|
|00000150| 6d 70 75 74 65 72 2c 20 | 49 6e 63 2e 20 41 6c 6c |mputer, |Inc. All|
|00000160| 20 72 69 67 68 74 73 20 | 72 65 73 65 72 76 65 64 | rights |reserved|
|00000170| 2e 0d 0d 09 43 68 61 6e | 67 65 20 48 69 73 74 6f |....Chan|ge Histo|
|00000180| 72 79 3a 0d 09 09 31 31 | 2f 31 30 2f 39 39 09 54 |ry:...11|/10/99.T|
|00000190| 57 42 09 09 43 6c 65 61 | 6e 20 75 70 20 74 68 65 |WB..Clea|n up the|
|000001a0| 20 70 72 69 76 61 74 65 | 20 69 6e 74 65 72 66 61 | private| interfa|
|000001b0| 63 65 73 2e 20 0d 09 09 | 31 30 2f 32 39 2f 39 38 |ces. ...|10/29/98|
|000001c0| 09 54 57 42 09 09 5a 6f | 6f 6d 20 73 75 70 70 6f |.TWB..Zo|om suppo|
|000001d0| 72 74 2e 20 0d 2a 2f 0d | 0d 0d 23 69 6e 63 6c 75 |rt. .*/.|..#inclu|
|000001e0| 64 65 20 22 57 41 53 54 | 45 49 6e 74 66 2e 68 22 |de "WAST|EIntf.h"|
|000001f0| 0d 0d 70 61 73 63 61 6c | 20 53 49 6e 74 33 32 20 |..pascal| SInt32 |
|00000200| 57 45 4f 66 66 73 65 74 | 54 6f 4c 69 6e 65 20 28 |WEOffset|ToLine (|
|00000210| 53 49 6e 74 33 32 20 6f | 66 66 73 65 74 2c 20 57 |SInt32 o|ffset, W|
|00000220| 45 48 61 6e 64 6c 65 20 | 68 57 45 29 0d 7b 0d 09 |EHandle |hWE).{..|
|00000230| 2f 2f 20 67 69 76 65 6e | 20 61 20 62 79 74 65 20 |// given| a byte |
|00000240| 6f 66 66 73 65 74 20 69 | 6e 74 6f 20 74 68 65 20 |offset i|nto the |
|00000250| 74 65 78 74 2c 20 66 69 | 6e 64 20 74 68 65 20 63 |text, fi|nd the c|
|00000260| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 20 6c 69 6e |orrespon|ding lin|
|00000270| 65 20 69 6e 64 65 78 0d | 0d 09 57 45 50 74 72 20 |e index.|..WEPtr |
|00000280| 70 57 45 20 3d 20 2a 68 | 57 45 3b 0d 09 57 45 4c |pWE = *h|WE;..WEL|
|00000290| 69 6e 65 52 65 63 20 2a | 70 4c 69 6e 65 73 20 3d |ineRec *|pLines =|
|000002a0| 20 2a 70 57 45 2d 3e 68 | 4c 69 6e 65 73 3b 0d 09 | *pWE->h|Lines;..|
|000002b0| 53 49 6e 74 33 32 20 6d | 69 6e 49 6e 64 65 78 20 |SInt32 m|inIndex |
|000002c0| 3d 20 30 3b 0d 09 53 49 | 6e 74 33 32 20 6d 61 78 |= 0;..SI|nt32 max|
|000002d0| 49 6e 64 65 78 20 3d 20 | 70 57 45 2d 3e 6e 4c 69 |Index = |pWE->nLi|
|000002e0| 6e 65 73 3b 0d 09 53 49 | 6e 74 33 32 20 69 6e 64 |nes;..SI|nt32 ind|
|000002f0| 65 78 20 3d 20 30 3b 0d | 0d 09 2f 2f 20 62 69 6e |ex = 0;.|..// bin|
|00000300| 61 72 79 2d 73 65 61 72 | 63 68 20 74 68 65 20 6c |ary-sear|ch the l|
|00000310| 69 6e 65 20 61 72 72 61 | 79 0d 0d 09 77 68 69 6c |ine arra|y...whil|
|00000320| 65 20 28 6d 69 6e 49 6e | 64 65 78 20 3c 20 6d 61 |e (minIn|dex < ma|
|00000330| 78 49 6e 64 65 78 29 0d | 09 7b 0d 09 09 69 6e 64 |xIndex).|.{...ind|
|00000340| 65 78 20 3d 20 28 6d 69 | 6e 49 6e 64 65 78 20 2b |ex = (mi|nIndex +|
|00000350| 20 6d 61 78 49 6e 64 65 | 78 29 20 3e 3e 20 31 3b | maxInde|x) >> 1;|
|00000360| 0d 09 09 69 66 20 28 6f | 66 66 73 65 74 20 3e 3d |...if (o|ffset >=|
|00000370| 20 70 4c 69 6e 65 73 5b | 69 6e 64 65 78 5d 2e 6c | pLines[|index].l|
|00000380| 69 6e 65 53 74 61 72 74 | 29 0d 09 09 7b 0d 09 09 |ineStart|)...{...|
|00000390| 09 69 66 20 28 6f 66 66 | 73 65 74 20 3c 20 70 4c |.if (off|set < pL|
|000003a0| 69 6e 65 73 5b 69 6e 64 | 65 78 20 2b 20 31 5d 2e |ines[ind|ex + 1].|
|000003b0| 6c 69 6e 65 53 74 61 72 | 74 29 0d 09 09 09 7b 0d |lineStar|t)....{.|
|000003c0| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 7d 0d |....brea|k;....}.|
|000003d0| 09 09 09 65 6c 73 65 0d | 09 09 09 7b 0d 09 09 09 |...else.|...{....|
|000003e0| 09 6d 69 6e 49 6e 64 65 | 78 20 3d 20 69 6e 64 65 |.minInde|x = inde|
|000003f0| 78 20 2b 20 31 3b 0d 09 | 09 09 7d 0d 09 09 7d 0d |x + 1;..|..}...}.|
|00000400| 09 09 65 6c 73 65 0d 09 | 09 7b 0d 09 09 09 6d 61 |..else..|.{....ma|
|00000410| 78 49 6e 64 65 78 20 3d | 20 69 6e 64 65 78 3b 0d |xIndex =| index;.|
|00000420| 09 09 7d 0d 09 7d 0d 0d | 09 72 65 74 75 72 6e 20 |..}..}..|.return |
|00000430| 69 6e 64 65 78 3b 0d 7d | 0d 0d 70 61 73 63 61 6c |index;.}|..pascal|
|00000440| 20 53 49 6e 74 33 32 20 | 57 45 43 6f 75 6e 74 4c | SInt32 |WECountL|
|00000450| 69 6e 65 73 28 57 45 48 | 61 6e 64 6c 65 20 68 57 |ines(WEH|andle hW|
|00000460| 45 29 0d 7b 0d 09 72 65 | 74 75 72 6e 20 28 2a 68 |E).{..re|turn (*h|
|00000470| 57 45 29 2d 3e 6e 4c 69 | 6e 65 73 3b 0d 7d 0d 0d |WE)->nLi|nes;.}..|
|00000480| 70 61 73 63 61 6c 20 76 | 6f 69 64 20 57 45 47 65 |pascal v|oid WEGe|
|00000490| 74 4c 69 6e 65 52 61 6e | 67 65 28 53 49 6e 74 33 |tLineRan|ge(SInt3|
|000004a0| 32 20 6c 69 6e 65 49 6e | 64 65 78 2c 20 53 49 6e |2 lineIn|dex, SIn|
|000004b0| 74 33 32 20 2a 6c 69 6e | 65 53 74 61 72 74 2c 20 |t32 *lin|eStart, |
|000004c0| 53 49 6e 74 33 32 20 2a | 6c 69 6e 65 45 6e 64 2c |SInt32 *|lineEnd,|
|000004d0| 20 57 45 48 61 6e 64 6c | 65 20 68 57 45 29 0d 7b | WEHandl|e hWE).{|
|000004e0| 0d 09 57 45 50 74 72 20 | 70 57 45 20 3d 20 2a 68 |..WEPtr |pWE = *h|
|000004f0| 57 45 3b 0d 09 57 45 4c | 69 6e 65 52 65 63 20 2a |WE;..WEL|ineRec *|
|00000500| 70 4c 69 6e 65 3b 0d 0d | 09 70 4c 69 6e 65 20 3d |pLine;..|.pLine =|
|00000510| 20 2a 70 57 45 2d 3e 68 | 4c 69 6e 65 73 20 2b 20 | *pWE->h|Lines + |
|00000520| 5f 57 45 50 69 6e 49 6e | 52 61 6e 67 65 28 6c 69 |_WEPinIn|Range(li|
|00000530| 6e 65 49 6e 64 65 78 2c | 20 30 2c 20 70 57 45 2d |neIndex,| 0, pWE-|
|00000540| 3e 6e 4c 69 6e 65 73 20 | 2d 20 31 29 3b 0d 09 69 |>nLines |- 1);..i|
|00000550| 66 20 28 6c 69 6e 65 53 | 74 61 72 74 20 21 3d 20 |f (lineS|tart != |
|00000560| 6e 69 6c 29 0d 09 7b 0d | 09 09 2a 6c 69 6e 65 53 |nil)..{.|..*lineS|
|00000570| 74 61 72 74 20 3d 20 70 | 4c 69 6e 65 5b 30 5d 2e |tart = p|Line[0].|
|00000580| 6c 69 6e 65 53 74 61 72 | 74 3b 0d 09 7d 0d 09 69 |lineStar|t;..}..i|
|00000590| 66 20 28 6c 69 6e 65 45 | 6e 64 20 21 3d 20 6e 69 |f (lineE|nd != ni|
|000005a0| 6c 29 0d 09 7b 0d 09 09 | 2a 6c 69 6e 65 45 6e 64 |l)..{...|*lineEnd|
|000005b0| 20 3d 20 70 4c 69 6e 65 | 5b 31 5d 2e 6c 69 6e 65 | = pLine|[1].line|
|000005c0| 53 74 61 72 74 3b 0d 09 | 7d 0d 7d 0d 0d 70 61 73 |Start;..|}.}..pas|
|000005d0| 63 61 6c 20 53 49 6e 74 | 33 32 20 57 45 4f 66 66 |cal SInt|32 WEOff|
|000005e0| 73 65 74 54 6f 52 75 6e | 20 28 53 49 6e 74 33 32 |setToRun| (SInt32|
|000005f0| 20 6f 66 66 73 65 74 2c | 20 57 45 48 61 6e 64 6c | offset,| WEHandl|
|00000600| 65 20 68 57 45 29 0d 7b | 0d 09 2f 2f 20 67 69 76 |e hWE).{|..// giv|
|00000610| 65 6e 20 61 20 62 79 74 | 65 20 6f 66 66 73 65 74 |en a byt|e offset|
|00000620| 20 69 6e 74 6f 20 74 68 | 65 20 74 65 78 74 2c 20 | into th|e text, |
|00000630| 66 69 6e 64 20 74 68 65 | 20 63 6f 72 72 65 73 70 |find the| corresp|
|00000640| 6f 6e 64 69 6e 67 20 73 | 74 79 6c 65 20 72 75 6e |onding s|tyle run|
|00000650| 20 69 6e 64 65 78 0d 0d | 09 57 45 50 74 72 20 70 | index..|.WEPtr p|
|00000660| 57 45 20 3d 20 2a 68 57 | 45 3b 0d 09 57 45 52 75 |WE = *hW|E;..WERu|
|00000670| 6e 41 72 72 61 79 45 6e | 74 72 79 20 2a 70 52 75 |nArrayEn|try *pRu|
|00000680| 6e 73 20 3d 20 2a 70 57 | 45 2d 3e 68 52 75 6e 73 |ns = *pW|E->hRuns|
|00000690| 3b 0d 09 53 49 6e 74 33 | 32 20 6d 69 6e 49 6e 64 |;..SInt3|2 minInd|
|000006a0| 65 78 20 3d 20 30 3b 0d | 09 53 49 6e 74 33 32 20 |ex = 0;.|.SInt32 |
|000006b0| 6d 61 78 49 6e 64 65 78 | 20 3d 20 70 57 45 2d 3e |maxIndex| = pWE->|
|000006c0| 6e 52 75 6e 73 3b 0d 09 | 53 49 6e 74 33 32 20 69 |nRuns;..|SInt32 i|
|000006d0| 6e 64 65 78 20 3d 20 30 | 3b 0d 0d 09 2f 2f 20 62 |ndex = 0|;...// b|
|000006e0| 69 6e 61 72 79 2d 73 65 | 61 72 63 68 20 74 68 65 |inary-se|arch the|
|000006f0| 20 73 74 79 6c 65 20 72 | 75 6e 20 61 72 72 61 79 | style r|un array|
|00000700| 0d 0d 09 77 68 69 6c 65 | 20 28 6d 69 6e 49 6e 64 |...while| (minInd|
|00000710| 65 78 20 3c 20 6d 61 78 | 49 6e 64 65 78 29 0d 09 |ex < max|Index)..|
|00000720| 7b 0d 09 09 69 6e 64 65 | 78 20 3d 20 28 6d 69 6e |{...inde|x = (min|
|00000730| 49 6e 64 65 78 20 2b 20 | 6d 61 78 49 6e 64 65 78 |Index + |maxIndex|
|00000740| 29 20 3e 3e 20 31 3b 0d | 09 09 69 66 20 28 6f 66 |) >> 1;.|..if (of|
|00000750| 66 73 65 74 20 3e 3d 20 | 70 52 75 6e 73 5b 69 6e |fset >= |pRuns[in|
|00000760| 64 65 78 5d 2e 72 75 6e | 53 74 61 72 74 29 0d 09 |dex].run|Start)..|
|00000770| 09 7b 0d 09 09 09 69 66 | 20 28 6f 66 66 73 65 74 |.{....if| (offset|
|00000780| 20 3c 20 70 52 75 6e 73 | 5b 69 6e 64 65 78 20 2b | < pRuns|[index +|
|00000790| 20 31 5d 2e 72 75 6e 53 | 74 61 72 74 29 0d 09 09 | 1].runS|tart)...|
|000007a0| 09 7b 0d 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |.{.....b|reak;...|
|000007b0| 09 7d 0d 09 09 09 65 6c | 73 65 0d 09 09 09 7b 0d |.}....el|se....{.|
|000007c0| 09 09 09 09 6d 69 6e 49 | 6e 64 65 78 20 3d 20 69 |....minI|ndex = i|
|000007d0| 6e 64 65 78 20 2b 20 31 | 3b 0d 09 09 09 7d 0d 09 |ndex + 1|;....}..|
|000007e0| 09 7d 0d 09 09 65 6c 73 | 65 0d 09 09 7b 0d 09 09 |.}...els|e...{...|
|000007f0| 09 6d 61 78 49 6e 64 65 | 78 20 3d 20 69 6e 64 65 |.maxInde|x = inde|
|00000800| 78 3b 0d 09 09 7d 0d 09 | 7d 0d 0d 09 72 65 74 75 |x;...}..|}...retu|
|00000810| 72 6e 20 69 6e 64 65 78 | 3b 0d 7d 0d 0d 70 61 73 |rn index|;.}..pas|
|00000820| 63 61 6c 20 53 49 6e 74 | 33 32 20 57 45 43 6f 75 |cal SInt|32 WECou|
|00000830| 6e 74 52 75 6e 73 28 57 | 45 48 61 6e 64 6c 65 20 |ntRuns(W|EHandle |
|00000840| 68 57 45 29 0d 7b 0d 09 | 72 65 74 75 72 6e 20 28 |hWE).{..|return (|
|00000850| 2a 68 57 45 29 2d 3e 6e | 52 75 6e 73 3b 0d 7d 0d |*hWE)->n|Runs;.}.|
|00000860| 0d 70 61 73 63 61 6c 20 | 76 6f 69 64 20 57 45 47 |.pascal |void WEG|
|00000870| 65 74 52 75 6e 52 61 6e | 67 65 28 53 49 6e 74 33 |etRunRan|ge(SInt3|
|00000880| 32 20 72 75 6e 49 6e 64 | 65 78 2c 20 53 49 6e 74 |2 runInd|ex, SInt|
|00000890| 33 32 20 2a 72 75 6e 53 | 74 61 72 74 2c 20 53 49 |32 *runS|tart, SI|
|000008a0| 6e 74 33 32 20 2a 72 75 | 6e 45 6e 64 2c 20 57 45 |nt32 *ru|nEnd, WE|
|000008b0| 48 61 6e 64 6c 65 20 68 | 57 45 29 0d 7b 0d 09 57 |Handle h|WE).{..W|
|000008c0| 45 50 74 72 20 70 57 45 | 20 3d 20 2a 68 57 45 3b |EPtr pWE| = *hWE;|
|000008d0| 0d 09 57 45 52 75 6e 41 | 72 72 61 79 45 6e 74 72 |..WERunA|rrayEntr|
|000008e0| 79 20 2a 70 52 75 6e 3b | 0d 0d 09 70 52 75 6e 20 |y *pRun;|...pRun |
|000008f0| 3d 20 2a 70 57 45 2d 3e | 68 52 75 6e 73 20 2b 20 |= *pWE->|hRuns + |
|00000900| 5f 57 45 50 69 6e 49 6e | 52 61 6e 67 65 28 72 75 |_WEPinIn|Range(ru|
|00000910| 6e 49 6e 64 65 78 2c 20 | 30 2c 20 70 57 45 2d 3e |nIndex, |0, pWE->|
|00000920| 6e 52 75 6e 73 20 2d 20 | 31 29 3b 0d 09 69 66 20 |nRuns - |1);..if |
|00000930| 28 72 75 6e 53 74 61 72 | 74 20 21 3d 20 6e 69 6c |(runStar|t != nil|
|00000940| 29 0d 09 7b 0d 09 09 2a | 72 75 6e 53 74 61 72 74 |)..{...*|runStart|
|00000950| 20 3d 20 70 52 75 6e 5b | 30 5d 2e 72 75 6e 53 74 | = pRun[|0].runSt|
|00000960| 61 72 74 3b 0d 09 7d 0d | 09 69 66 20 28 72 75 6e |art;..}.|.if (run|
|00000970| 45 6e 64 20 21 3d 20 6e | 69 6c 29 0d 09 7b 0d 09 |End != n|il)..{..|
|00000980| 09 2a 72 75 6e 45 6e 64 | 20 3d 20 70 52 75 6e 5b |.*runEnd| = pRun[|
|00000990| 31 5d 2e 72 75 6e 53 74 | 61 72 74 3b 0d 09 09 69 |1].runSt|art;...i|
|000009a0| 66 20 28 2a 72 75 6e 45 | 6e 64 20 3e 20 70 57 45 |f (*runE|nd > pWE|
|000009b0| 2d 3e 74 65 78 74 4c 65 | 6e 67 74 68 29 0d 09 09 |->textLe|ngth)...|
|000009c0| 7b 0d 09 09 09 2a 72 75 | 6e 45 6e 64 20 3d 20 70 |{....*ru|nEnd = p|
|000009d0| 57 45 2d 3e 74 65 78 74 | 4c 65 6e 67 74 68 3b 0d |WE->text|Length;.|
|000009e0| 09 09 7d 0d 09 7d 0d 7d | 0d 0d 70 61 73 63 61 6c |..}..}.}|..pascal|
|000009f0| 20 53 49 6e 74 33 32 20 | 5f 57 45 50 69 78 65 6c | SInt32 |_WEPixel|
|00000a00| 54 6f 4c 69 6e 65 28 53 | 49 6e 74 33 32 20 76 4f |ToLine(S|Int32 vO|
|00000a10| 66 66 73 65 74 2c 20 57 | 45 48 61 6e 64 6c 65 20 |ffset, W|EHandle |
|00000a20| 68 57 45 29 0d 7b 0d 09 | 2f 2f 20 67 69 76 65 6e |hWE).{..|// given|
|00000a30| 20 61 20 76 65 72 74 69 | 63 61 6c 20 70 69 78 65 | a verti|cal pixe|
|00000a40| 6c 20 6f 66 66 73 65 74 | 20 69 6e 20 6c 6f 63 61 |l offset| in loca|
|00000a50| 6c 20 63 6f 6f 72 64 69 | 6e 61 74 65 73 2c 0d 09 |l coordi|nates,..|
|00000a60| 2f 2f 20 66 69 6e 64 20 | 74 68 65 20 63 6f 72 72 |// find |the corr|
|00000a70| 65 73 70 6f 6e 64 69 6e | 67 20 6c 69 6e 65 20 69 |espondin|g line i|
|00000a80| 6e 64 65 78 0d 0d 09 57 | 45 50 74 72 20 70 57 45 |ndex...W|EPtr pWE|
|00000a90| 20 3d 20 2a 68 57 45 3b | 0d 09 57 45 4c 69 6e 65 | = *hWE;|..WELine|
|00000aa0| 52 65 63 20 2a 70 4c 69 | 6e 65 73 20 3d 20 2a 70 |Rec *pLi|nes = *p|
|00000ab0| 57 45 2d 3e 68 4c 69 6e | 65 73 3b 0d 09 53 49 6e |WE->hLin|es;..SIn|
|00000ac0| 74 33 32 20 6d 69 6e 49 | 6e 64 65 78 20 3d 20 30 |t32 minI|ndex = 0|
|00000ad0| 3b 0d 09 53 49 6e 74 33 | 32 20 6d 61 78 49 6e 64 |;..SInt3|2 maxInd|
|00000ae0| 65 78 20 3d 20 70 57 45 | 2d 3e 6e 4c 69 6e 65 73 |ex = pWE|->nLines|
|00000af0| 3b 0d 09 53 49 6e 74 33 | 32 20 69 6e 64 65 78 20 |;..SInt3|2 index |
|00000b00| 3d 20 30 3b 0d 0d 09 2f | 2f 20 62 69 6e 61 72 79 |= 0;.../|/ binary|
|00000b10| 2d 73 65 61 72 63 68 20 | 74 68 65 20 6c 69 6e 65 |-search |the line|
|00000b20| 20 61 72 72 61 79 0d 0d | 09 77 68 69 6c 65 20 28 | array..|.while (|
|00000b30| 6d 69 6e 49 6e 64 65 78 | 20 3c 20 6d 61 78 49 6e |minIndex| < maxIn|
|00000b40| 64 65 78 29 0d 09 7b 0d | 09 09 69 6e 64 65 78 20 |dex)..{.|..index |
|00000b50| 3d 20 28 6d 69 6e 49 6e | 64 65 78 20 2b 20 6d 61 |= (minIn|dex + ma|
|00000b60| 78 49 6e 64 65 78 29 20 | 3e 3e 20 31 3b 0d 09 09 |xIndex) |>> 1;...|
|00000b70| 69 66 20 28 76 4f 66 66 | 73 65 74 20 3e 3d 20 70 |if (vOff|set >= p|
|00000b80| 4c 69 6e 65 73 5b 69 6e | 64 65 78 5d 2e 6c 69 6e |Lines[in|dex].lin|
|00000b90| 65 4f 72 69 67 69 6e 29 | 0d 09 09 7b 0d 09 09 09 |eOrigin)|...{....|
|00000ba0| 69 66 20 28 76 4f 66 66 | 73 65 74 20 3c 20 70 4c |if (vOff|set < pL|
|00000bb0| 69 6e 65 73 5b 69 6e 64 | 65 78 20 2b 20 31 5d 2e |ines[ind|ex + 1].|
|00000bc0| 6c 69 6e 65 4f 72 69 67 | 69 6e 29 0d 09 09 09 7b |lineOrig|in)....{|
|00000bd0| 0d 09 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 09 7d |.....bre|ak;....}|
|00000be0| 0d 09 09 09 65 6c 73 65 | 0d 09 09 09 7b 0d 09 09 |....else|....{...|
|00000bf0| 09 09 6d 69 6e 49 6e 64 | 65 78 20 3d 20 69 6e 64 |..minInd|ex = ind|
|00000c00| 65 78 20 2b 20 31 3b 0d | 09 09 09 7d 0d 09 09 7d |ex + 1;.|...}...}|
|00000c10| 0d 09 09 65 6c 73 65 0d | 09 09 7b 0d 09 09 09 6d |...else.|..{....m|
|00000c20| 61 78 49 6e 64 65 78 20 | 3d 20 69 6e 64 65 78 3b |axIndex |= index;|
|00000c30| 0d 09 09 7d 0d 09 7d 0d | 0d 09 72 65 74 75 72 6e |...}..}.|..return|
|00000c40| 20 69 6e 64 65 78 3b 0d | 7d 0d 0d 70 61 73 63 61 | index;.|}..pasca|
|00000c50| 6c 20 76 6f 69 64 20 5f | 57 45 47 65 74 49 6e 64 |l void _|WEGetInd|
|00000c60| 53 74 79 6c 65 28 53 49 | 6e 74 33 32 20 72 75 6e |Style(SI|nt32 run|
|00000c70| 49 6e 64 65 78 2c 20 57 | 45 52 75 6e 49 6e 66 6f |Index, W|ERunInfo|
|00000c80| 50 72 69 76 20 2a 69 6e | 66 6f 2c 20 57 45 48 61 |Priv *in|fo, WEHa|
|00000c90| 6e 64 6c 65 20 68 57 45 | 29 0d 7b 0d 09 57 45 50 |ndle hWE|).{..WEP|
|00000ca0| 74 72 20 70 57 45 20 3d | 20 2a 68 57 45 3b 09 2f |tr pWE =| *hWE;./|
|00000cb0| 2f 20 61 73 73 75 6d 65 | 20 57 45 20 72 65 63 6f |/ assume| WE reco|
|00000cc0| 72 64 20 69 73 20 61 6c | 72 65 61 64 79 20 6c 6f |rd is al|ready lo|
|00000cd0| 63 6b 65 64 0d 09 57 45 | 52 75 6e 41 72 72 61 79 |cked..WE|RunArray|
|00000ce0| 45 6e 74 72 79 20 2a 70 | 52 75 6e 3b 0d 0d 09 2f |Entry *p|Run;.../|
|00000cf0| 2f 20 67 65 74 20 61 20 | 70 6f 69 6e 74 65 72 20 |/ get a |pointer |
|00000d00| 74 6f 20 74 68 65 20 73 | 70 65 63 69 66 69 65 64 |to the s|pecified|
|00000d10| 20 72 75 6e 20 61 72 72 | 61 79 20 65 6e 74 72 79 | run arr|ay entry|
|00000d20| 0d 09 70 52 75 6e 20 3d | 20 2a 70 57 45 2d 3e 68 |..pRun =| *pWE->h|
|00000d30| 52 75 6e 73 20 2b 20 72 | 75 6e 49 6e 64 65 78 3b |Runs + r|unIndex;|
|00000d40| 0d 0d 09 2f 2f 20 66 69 | 6c 6c 20 69 6e 20 74 68 |...// fi|ll in th|
|00000d50| 65 20 72 75 6e 53 74 61 | 72 74 20 61 6e 64 20 72 |e runSta|rt and r|
|00000d60| 75 6e 45 6e 64 20 66 69 | 65 6c 64 73 20 66 72 6f |unEnd fi|elds fro|
|00000d70| 6d 20 74 68 65 20 73 74 | 79 6c 65 20 72 75 6e 20 |m the st|yle run |
|00000d80| 61 72 72 61 79 0d 09 69 | 6e 66 6f 2d 3e 72 75 6e |array..i|nfo->run|
|00000d90| 53 74 61 72 74 20 3d 20 | 70 52 75 6e 5b 30 5d 2e |Start = |pRun[0].|
|00000da0| 72 75 6e 53 74 61 72 74 | 3b 0d 09 69 6e 66 6f 2d |runStart|;..info-|
|00000db0| 3e 72 75 6e 45 6e 64 20 | 3d 20 70 52 75 6e 5b 31 |>runEnd |= pRun[1|
|00000dc0| 5d 2e 72 75 6e 53 74 61 | 72 74 3b 0d 0d 09 2f 2f |].runSta|rt;...//|
|00000dd0| 20 63 6f 70 79 20 74 68 | 65 20 73 74 79 6c 65 20 | copy th|e style |
|00000de0| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 66 72 6f 6d |informat|ion from|
|00000df0| 20 74 68 65 20 61 70 70 | 72 6f 70 72 69 61 74 65 | the app|ropriate|
|00000e00| 20 65 6e 74 72 79 20 69 | 6e 20 74 68 65 20 73 74 | entry i|n the st|
|00000e10| 79 6c 65 20 74 61 62 6c | 65 0d 09 69 6e 66 6f 2d |yle tabl|e..info-|
|00000e20| 3e 72 75 6e 41 74 74 72 | 73 20 3d 20 28 2a 70 57 |>runAttr|s = (*pW|
|00000e30| 45 2d 3e 68 53 74 79 6c | 65 73 29 5b 70 52 75 6e |E->hStyl|es)[pRun|
|00000e40| 2d 3e 73 74 79 6c 65 49 | 6e 64 65 78 5d 2e 69 6e |->styleI|ndex].in|
|00000e50| 66 6f 3b 0d 7d 0d 0d 70 | 61 73 63 61 6c 20 42 6f |fo;.}..p|ascal Bo|
|00000e60| 6f 6c 65 61 6e 20 5f 57 | 45 47 65 74 49 6e 64 44 |olean _W|EGetIndD|
|00000e70| 69 72 65 63 74 69 6f 6e | 28 53 49 6e 74 33 32 20 |irection|(SInt32 |
|00000e80| 72 75 6e 49 6e 64 65 78 | 2c 20 57 45 48 61 6e 64 |runIndex|, WEHand|
|00000e90| 6c 65 20 68 57 45 29 0d | 7b 0d 09 57 45 50 74 72 |le hWE).|{..WEPtr|
|00000ea0| 20 70 57 45 20 3d 20 2a | 68 57 45 3b 0d 0d 09 2f | pWE = *|hWE;.../|
|00000eb0| 2f 20 74 68 65 20 68 69 | 67 68 20 62 69 74 20 6f |/ the hi|gh bit o|
|00000ec0| 66 20 74 73 46 6c 61 67 | 73 20 69 73 20 73 65 74 |f tsFlag|s is set|
|00000ed0| 20 69 66 20 74 68 65 20 | 63 6f 72 72 65 73 70 6f | if the |correspo|
|00000ee0| 6e 64 69 6e 67 20 72 75 | 6e 20 69 73 20 72 69 67 |nding ru|n is rig|
|00000ef0| 68 74 2d 74 6f 2d 6c 65 | 66 74 0d 09 72 65 74 75 |ht-to-le|ft..retu|
|00000f00| 72 6e 20 42 54 53 54 28 | 28 2a 70 57 45 2d 3e 68 |rn BTST(|(*pWE->h|
|00000f10| 53 74 79 6c 65 73 20 2b | 20 28 2a 70 57 45 2d 3e |Styles +| (*pWE->|
|00000f20| 68 52 75 6e 73 20 2b 20 | 72 75 6e 49 6e 64 65 78 |hRuns + |runIndex|
|00000f30| 29 2d 3e 73 74 79 6c 65 | 49 6e 64 65 78 29 2d 3e |)->style|Index)->|
|00000f40| 69 6e 66 6f 2e 72 75 6e | 53 74 79 6c 65 2e 74 73 |info.run|Style.ts|
|00000f50| 46 6c 61 67 73 2c 20 74 | 73 52 69 67 68 74 54 6f |Flags, t|sRightTo|
|00000f60| 4c 65 66 74 29 20 3f 20 | 74 72 75 65 20 3a 20 66 |Left) ? |true : f|
|00000f70| 61 6c 73 65 3b 0d 7d 0d | 0d 70 61 73 63 61 6c 20 |alse;.}.|.pascal |
|00000f80| 42 6f 6f 6c 65 61 6e 20 | 57 45 47 65 74 52 75 6e |Boolean |WEGetRun|
|00000f90| 44 69 72 65 63 74 69 6f | 6e 28 53 49 6e 74 33 32 |Directio|n(SInt32|
|00000fa0| 20 6f 66 66 73 65 74 2c | 20 57 45 48 61 6e 64 6c | offset,| WEHandl|
|00000fb0| 65 20 68 57 45 29 0d 7b | 0d 09 57 45 50 74 72 20 |e hWE).{|..WEPtr |
|00000fc0| 70 57 45 20 3d 20 2a 68 | 57 45 3b 0d 0d 09 2f 2f |pWE = *h|WE;...//|
|00000fd0| 09 69 66 20 6f 66 66 73 | 65 74 20 69 73 20 6f 75 |.if offs|et is ou|
|00000fe0| 74 20 6f 66 20 72 61 6e | 67 65 2c 20 72 65 74 75 |t of ran|ge, retu|
|00000ff0| 72 6e 20 74 68 65 20 70 | 72 69 6d 61 72 79 20 6c |rn the p|rimary l|
|00001000| 69 6e 65 20 64 69 72 65 | 63 74 69 6f 6e 0d 09 69 |ine dire|ction..i|
|00001010| 66 20 28 28 6f 66 66 73 | 65 74 20 3c 20 30 29 20 |f ((offs|et < 0) |
|00001020| 7c 7c 20 28 6f 66 66 73 | 65 74 20 3e 3d 20 70 57 ||| (offs|et >= pW|
|00001030| 45 2d 3e 74 65 78 74 4c | 65 6e 67 74 68 29 29 0d |E->textL|ength)).|
|00001040| 09 7b 0d 09 09 72 65 74 | 75 72 6e 20 49 73 52 69 |.{...ret|urn IsRi|
|00001050| 67 68 74 54 6f 4c 65 66 | 74 28 70 57 45 2d 3e 64 |ghtToLef|t(pWE->d|
|00001060| 69 72 65 63 74 69 6f 6e | 29 3b 0d 09 7d 0d 0d 09 |irection|);..}...|
|00001070| 72 65 74 75 72 6e 20 5f | 57 45 47 65 74 49 6e 64 |return _|WEGetInd|
|00001080| 44 69 72 65 63 74 69 6f | 6e 28 57 45 4f 66 66 73 |Directio|n(WEOffs|
|00001090| 65 74 54 6f 52 75 6e 28 | 6f 66 66 73 65 74 2c 20 |etToRun(|offset, |
|000010a0| 68 57 45 29 2c 20 68 57 | 45 29 3b 0d 7d 0d 0d 70 |hWE), hW|E);.}..p|
|000010b0| 61 73 63 61 6c 20 76 6f | 69 64 20 57 45 47 65 74 |ascal vo|id WEGet|
|000010c0| 52 75 6e 49 6e 66 6f 28 | 53 49 6e 74 33 32 20 6f |RunInfo(|SInt32 o|
|000010d0| 66 66 73 65 74 2c 20 57 | 45 52 75 6e 49 6e 66 6f |ffset, W|ERunInfo|
|000010e0| 20 2a 69 6e 66 6f 2c 20 | 57 45 48 61 6e 64 6c 65 | *info, |WEHandle|
|000010f0| 20 68 57 45 29 0d 7b 0d | 09 5f 57 45 47 65 74 49 | hWE).{.|._WEGetI|
|00001100| 6e 64 53 74 79 6c 65 28 | 57 45 4f 66 66 73 65 74 |ndStyle(|WEOffset|
|00001110| 54 6f 52 75 6e 28 6f 66 | 66 73 65 74 2c 20 68 57 |ToRun(of|fset, hW|
|00001120| 45 29 2c 20 28 57 45 52 | 75 6e 49 6e 66 6f 50 72 |E), (WER|unInfoPr|
|00001130| 69 76 20 2a 29 69 6e 66 | 6f 2c 20 68 57 45 29 3b |iv *)inf|o, hWE);|
|00001140| 0d 7d 0d 0d 70 61 73 63 | 61 6c 20 53 49 6e 74 33 |.}..pasc|al SInt3|
|00001150| 32 20 57 45 47 65 74 48 | 65 69 67 68 74 28 53 49 |2 WEGetH|eight(SI|
|00001160| 6e 74 33 32 20 73 74 61 | 72 74 4c 69 6e 65 2c 20 |nt32 sta|rtLine, |
|00001170| 53 49 6e 74 33 32 20 65 | 6e 64 4c 69 6e 65 2c 20 |SInt32 e|ndLine, |
|00001180| 57 45 48 61 6e 64 6c 65 | 20 68 57 45 29 0d 7b 0d |WEHandle| hWE).{.|
|00001190| 09 57 45 50 74 72 20 70 | 57 45 20 3d 20 2a 68 57 |.WEPtr p|WE = *hW|
|000011a0| 45 3b 0d 09 57 45 4c 69 | 6e 65 52 65 63 20 2a 70 |E;..WELi|neRec *p|
|000011b0| 4c 69 6e 65 73 20 3d 20 | 2a 70 57 45 2d 3e 68 4c |Lines = |*pWE->hL|
|000011c0| 69 6e 65 73 3b 0d 09 53 | 49 6e 74 33 32 20 6e 4c |ines;..S|Int32 nL|
|000011d0| 69 6e 65 73 20 3d 20 70 | 57 45 2d 3e 6e 4c 69 6e |ines = p|WE->nLin|
|000011e0| 65 73 3b 0d 0d 09 73 74 | 61 72 74 4c 69 6e 65 20 |es;...st|artLine |
|000011f0| 3d 20 5f 57 45 50 69 6e | 49 6e 52 61 6e 67 65 28 |= _WEPin|InRange(|
|00001200| 73 74 61 72 74 4c 69 6e | 65 2c 20 30 2c 20 6e 4c |startLin|e, 0, nL|
|00001210| 69 6e 65 73 29 3b 0d 09 | 65 6e 64 4c 69 6e 65 20 |ines);..|endLine |
|00001220| 3d 20 5f 57 45 50 69 6e | 49 6e 52 61 6e 67 65 28 |= _WEPin|InRange(|
|00001230| 65 6e 64 4c 69 6e 65 2c | 20 30 2c 20 6e 4c 69 6e |endLine,| 0, nLin|
|00001240| 65 73 29 3b 0d 09 5f 57 | 45 52 65 6f 72 64 65 72 |es);.._W|EReorder|
|00001250| 28 26 73 74 61 72 74 4c | 69 6e 65 2c 20 26 65 6e |(&startL|ine, &en|
|00001260| 64 4c 69 6e 65 29 3b 0d | 09 72 65 74 75 72 6e 20 |dLine);.|.return |
|00001270| 70 4c 69 6e 65 73 5b 65 | 6e 64 4c 69 6e 65 5d 2e |pLines[e|ndLine].|
|00001280| 6c 69 6e 65 4f 72 69 67 | 69 6e 20 2d 20 70 4c 69 |lineOrig|in - pLi|
|00001290| 6e 65 73 5b 73 74 61 72 | 74 4c 69 6e 65 5d 2e 6c |nes[star|tLine].l|
|000012a0| 69 6e 65 4f 72 69 67 69 | 6e 3b 0d 7d 0d 0d 70 61 |ineOrigi|n;.}..pa|
|000012b0| 73 63 61 6c 20 48 61 6e | 64 6c 65 20 57 45 47 65 |scal Han|dle WEGe|
|000012c0| 74 54 65 78 74 28 57 45 | 48 61 6e 64 6c 65 20 68 |tText(WE|Handle h|
|000012d0| 57 45 29 0d 7b 0d 09 72 | 65 74 75 72 6e 20 28 2a |WE).{..r|eturn (*|
|000012e0| 68 57 45 29 2d 3e 68 54 | 65 78 74 3b 0d 7d 0d 0d |hWE)->hT|ext;.}..|
|000012f0| 70 61 73 63 61 6c 20 53 | 49 6e 74 31 36 20 57 45 |pascal S|Int16 WE|
|00001300| 47 65 74 43 68 61 72 28 | 53 49 6e 74 33 32 20 6f |GetChar(|SInt32 o|
|00001310| 66 66 73 65 74 2c 20 57 | 45 48 61 6e 64 6c 65 20 |ffset, W|EHandle |
|00001320| 68 57 45 29 0d 7b 0d 09 | 57 45 50 74 72 20 70 57 |hWE).{..|WEPtr pW|
|00001330| 45 20 3d 20 2a 68 57 45 | 3b 0d 0d 09 2f 2f 20 73 |E = *hWE|;...// s|
|00001340| 61 6e 69 74 79 20 63 68 | 65 63 6b 3a 20 6d 61 6b |anity ch|eck: mak|
|00001350| 65 20 73 75 72 65 20 6f | 66 66 73 65 74 20 69 73 |e sure o|ffset is|
|00001360| 20 77 69 74 68 69 6e 67 | 20 61 6c 6c 6f 77 65 64 | withing| allowed|
|00001370| 20 62 6f 75 6e 64 73 0d | 09 69 66 20 28 28 6f 66 | bounds.|.if ((of|
|00001380| 66 73 65 74 20 3c 20 30 | 29 20 7c 7c 20 28 6f 66 |fset < 0|) || (of|
|00001390| 66 73 65 74 20 3e 3d 20 | 70 57 45 2d 3e 74 65 78 |fset >= |pWE->tex|
|000013a0| 74 4c 65 6e 67 74 68 29 | 29 0d 09 7b 0d 09 09 72 |tLength)|)..{...r|
|000013b0| 65 74 75 72 6e 20 30 3b | 0d 09 7d 0d 0d 09 2f 2f |eturn 0;|..}...//|
|000013c0| 20 67 65 74 20 74 68 65 | 20 73 70 65 63 69 66 69 | get the| specifi|
|000013d0| 65 64 20 63 68 61 72 61 | 63 74 65 72 20 28 61 63 |ed chara|cter (ac|
|000013e0| 74 75 61 6c 6c 79 2c 20 | 62 79 74 65 29 0d 09 72 |tually, |byte)..r|
|000013f0| 65 74 75 72 6e 20 2a 20 | 28 55 49 6e 74 38 20 2a |eturn * |(UInt8 *|
|00001400| 29 20 28 2a 70 57 45 2d | 3e 68 54 65 78 74 20 2b |) (*pWE-|>hText +|
|00001410| 20 6f 66 66 73 65 74 29 | 3b 0d 7d 0d 0d 70 61 73 | offset)|;.}..pas|
|00001420| 63 61 6c 20 57 45 41 6c | 69 67 6e 6d 65 6e 74 20 |cal WEAl|ignment |
|00001430| 57 45 47 65 74 41 6c 69 | 67 6e 6d 65 6e 74 28 57 |WEGetAli|gnment(W|
|00001440| 45 48 61 6e 64 6c 65 20 | 68 57 45 29 0d 7b 0d 09 |EHandle |hWE).{..|
|00001450| 72 65 74 75 72 6e 20 28 | 2a 68 57 45 29 2d 3e 61 |return (|*hWE)->a|
|00001460| 6c 69 67 6e 6d 65 6e 74 | 3b 0d 7d 0d 0d 70 61 73 |lignment|;.}..pas|
|00001470| 63 61 6c 20 57 45 44 69 | 72 65 63 74 69 6f 6e 20 |cal WEDi|rection |
|00001480| 57 45 47 65 74 44 69 72 | 65 63 74 69 6f 6e 28 57 |WEGetDir|ection(W|
|00001490| 45 48 61 6e 64 6c 65 20 | 68 57 45 29 0d 7b 0d 09 |EHandle |hWE).{..|
|000014a0| 72 65 74 75 72 6e 20 28 | 2a 68 57 45 29 2d 3e 64 |return (|*hWE)->d|
|000014b0| 69 72 65 63 74 69 6f 6e | 3b 0d 7d 0d 0d 70 61 73 |irection|;.}..pas|
|000014c0| 63 61 6c 20 76 6f 69 64 | 20 57 45 47 65 74 53 65 |cal void| WEGetSe|
|000014d0| 6c 65 63 74 69 6f 6e 28 | 53 49 6e 74 33 32 20 2a |lection(|SInt32 *|
|000014e0| 73 65 6c 53 74 61 72 74 | 2c 20 53 49 6e 74 33 32 |selStart|, SInt32|
|000014f0| 20 2a 73 65 6c 45 6e 64 | 2c 20 57 45 48 61 6e 64 | *selEnd|, WEHand|
|00001500| 6c 65 20 68 57 45 29 0d | 7b 0d 09 57 45 50 74 72 |le hWE).|{..WEPtr|
|00001510| 20 70 57 45 20 3d 20 2a | 68 57 45 3b 0d 0d 09 2a | pWE = *|hWE;...*|
|00001520| 73 65 6c 53 74 61 72 74 | 20 3d 20 70 57 45 2d 3e |selStart| = pWE->|
|00001530| 73 65 6c 53 74 61 72 74 | 3b 0d 09 2a 73 65 6c 45 |selStart|;..*selE|
|00001540| 6e 64 20 3d 20 70 57 45 | 2d 3e 73 65 6c 45 6e 64 |nd = pWE|->selEnd|
|00001550| 3b 0d 7d 0d 0d 70 61 73 | 63 61 6c 20 76 6f 69 64 |;.}..pas|cal void|
|00001560| 20 57 45 53 65 74 44 65 | 73 74 52 65 63 74 28 63 | WESetDe|stRect(c|
|00001570| 6f 6e 73 74 20 4c 6f 6e | 67 52 65 63 74 20 2a 64 |onst Lon|gRect *d|
|00001580| 65 73 74 52 65 63 74 2c | 20 57 45 48 61 6e 64 6c |estRect,| WEHandl|
|00001590| 65 20 68 57 45 29 0d 7b | 0d 09 28 2a 68 57 45 29 |e hWE).{|..(*hWE)|
|000015a0| 2d 3e 64 65 73 74 52 65 | 63 74 20 3d 20 2a 64 65 |->destRe|ct = *de|
|000015b0| 73 74 52 65 63 74 3b 0d | 7d 0d 0d 70 61 73 63 61 |stRect;.|}..pasca|
|000015c0| 6c 20 76 6f 69 64 20 57 | 45 47 65 74 44 65 73 74 |l void W|EGetDest|
|000015d0| 52 65 63 74 28 4c 6f 6e | 67 52 65 63 74 20 2a 64 |Rect(Lon|gRect *d|
|000015e0| 65 73 74 52 65 63 74 2c | 20 57 45 48 61 6e 64 6c |estRect,| WEHandl|
|000015f0| 65 20 68 57 45 29 0d 7b | 0d 09 2a 64 65 73 74 52 |e hWE).{|..*destR|
|00001600| 65 63 74 20 3d 20 28 2a | 68 57 45 29 2d 3e 64 65 |ect = (*|hWE)->de|
|00001610| 73 74 52 65 63 74 3b 0d | 7d 0d 0d 70 61 73 63 61 |stRect;.|}..pasca|
|00001620| 6c 20 76 6f 69 64 20 57 | 45 53 65 74 56 69 65 77 |l void W|ESetView|
|00001630| 52 65 63 74 28 63 6f 6e | 73 74 20 4c 6f 6e 67 52 |Rect(con|st LongR|
|00001640| 65 63 74 20 2a 76 69 65 | 77 52 65 63 74 2c 20 57 |ect *vie|wRect, W|
|00001650| 45 48 61 6e 64 6c 65 20 | 68 57 45 29 0d 7b 0d 09 |EHandle |hWE).{..|
|00001660| 57 45 50 74 72 20 70 57 | 45 20 3d 20 2a 68 57 45 |WEPtr pW|E = *hWE|
|00001670| 3b 0d 09 52 65 63 74 20 | 72 3b 0d 0d 09 70 57 45 |;..Rect |r;...pWE|
|00001680| 2d 3e 76 69 65 77 52 65 | 63 74 20 3d 20 2a 76 69 |->viewRe|ct = *vi|
|00001690| 65 77 52 65 63 74 3b 0d | 0d 09 2f 2f 20 6b 65 65 |ewRect;.|..// kee|
|000016a0| 70 20 74 68 65 20 76 69 | 65 77 52 67 6e 20 69 6e |p the vi|ewRgn in|
|000016b0| 20 73 79 6e 63 20 77 69 | 74 68 20 74 68 65 20 76 | sync wi|th the v|
|000016c0| 69 65 77 20 72 65 63 74 | 61 6e 67 6c 65 0d 09 57 |iew rect|angle..W|
|000016d0| 45 4c 6f 6e 67 52 65 63 | 74 54 6f 52 65 63 74 28 |ELongRec|tToRect(|
|000016e0| 76 69 65 77 52 65 63 74 | 2c 20 26 72 29 3b 0d 09 |viewRect|, &r);..|
|000016f0| 52 65 63 74 52 67 6e 28 | 70 57 45 2d 3e 76 69 65 |RectRgn(|pWE->vie|
|00001700| 77 52 67 6e 2c 20 26 72 | 29 3b 0d 7d 0d 0d 70 61 |wRgn, &r|);.}..pa|
|00001710| 73 63 61 6c 20 76 6f 69 | 64 20 57 45 47 65 74 56 |scal voi|d WEGetV|
|00001720| 69 65 77 52 65 63 74 28 | 4c 6f 6e 67 52 65 63 74 |iewRect(|LongRect|
|00001730| 20 2a 76 69 65 77 52 65 | 63 74 2c 20 57 45 48 61 | *viewRe|ct, WEHa|
|00001740| 6e 64 6c 65 20 68 57 45 | 29 0d 7b 0d 09 2a 76 69 |ndle hWE|).{..*vi|
|00001750| 65 77 52 65 63 74 20 3d | 20 28 2a 68 57 45 29 2d |ewRect =| (*hWE)-|
|00001760| 3e 76 69 65 77 52 65 63 | 74 3b 0d 7d 0d 0d 70 61 |>viewRec|t;.}..pa|
|00001770| 73 63 61 6c 20 53 49 6e | 74 33 32 20 57 45 47 65 |scal SIn|t32 WEGe|
|00001780| 74 54 65 78 74 4c 65 6e | 67 74 68 28 57 45 48 61 |tTextLen|gth(WEHa|
|00001790| 6e 64 6c 65 20 68 57 45 | 29 0d 7b 0d 09 72 65 74 |ndle hWE|).{..ret|
|000017a0| 75 72 6e 20 28 2a 68 57 | 45 29 2d 3e 74 65 78 74 |urn (*hW|E)->text|
|000017b0| 4c 65 6e 67 74 68 3b 0d | 7d 0d 0d 70 61 73 63 61 |Length;.|}..pasca|
|000017c0| 6c 20 53 49 6e 74 31 36 | 20 57 45 46 65 61 74 75 |l SInt16| WEFeatu|
|000017d0| 72 65 46 6c 61 67 28 53 | 49 6e 74 31 36 20 66 65 |reFlag(S|Int16 fe|
|000017e0| 61 74 75 72 65 2c 20 53 | 49 6e 74 31 36 20 61 63 |ature, S|Int16 ac|
|000017f0| 74 69 6f 6e 2c 20 57 45 | 48 61 6e 64 6c 65 20 68 |tion, WE|Handle h|
|00001800| 57 45 29 0d 7b 0d 09 57 | 45 50 74 72 20 70 57 45 |WE).{..W|EPtr pWE|
|00001810| 20 3d 20 2a 68 57 45 3b | 0d 09 53 49 6e 74 31 36 | = *hWE;|..SInt16|
|00001820| 20 73 74 61 74 75 73 3b | 0d 0d 09 2f 2f 20 67 65 | status;|...// ge|
|00001830| 74 20 63 75 72 72 65 6e | 74 20 73 74 61 74 75 73 |t curren|t status|
|00001840| 20 6f 66 20 74 68 65 20 | 73 70 65 63 69 66 69 65 | of the |specifie|
|00001850| 64 20 66 65 61 74 75 72 | 65 0d 09 73 74 61 74 75 |d featur|e..statu|
|00001860| 73 20 3d 20 42 54 53 54 | 28 70 57 45 2d 3e 66 65 |s = BTST|(pWE->fe|
|00001870| 61 74 75 72 65 73 2c 20 | 66 65 61 74 75 72 65 29 |atures, |feature)|
|00001880| 20 3f 20 77 65 42 69 74 | 53 65 74 20 3a 20 77 65 | ? weBit|Set : we|
|00001890| 42 69 74 43 6c 65 61 72 | 3b 0d 0d 09 2f 2f 20 69 |BitClear|;...// i|
|000018a0| 66 20 61 63 74 69 6f 6e | 20 69 73 20 77 65 42 69 |f action| is weBi|
|000018b0| 74 54 6f 67 67 6c 65 2c | 20 69 6e 76 65 72 74 20 |tToggle,| invert |
|000018c0| 66 6c 61 67 0d 09 69 66 | 20 28 61 63 74 69 6f 6e |flag..if| (action|
|000018d0| 20 3d 3d 20 77 65 42 69 | 74 54 6f 67 67 6c 65 29 | == weBi|tToggle)|
|000018e0| 0d 09 7b 0d 09 09 61 63 | 74 69 6f 6e 20 3d 20 31 |..{...ac|tion = 1|
|000018f0| 20 2d 20 73 74 61 74 75 | 73 3b 0d 09 7d 0d 0d 09 | - statu|s;..}...|
|00001900| 2f 2f 20 72 65 73 65 74 | 20 66 6c 61 67 20 61 63 |// reset| flag ac|
|00001910| 63 6f 72 64 69 6e 67 20 | 74 6f 20 61 63 74 69 6f |cording |to actio|
|00001920| 6e 0d 09 69 66 20 28 61 | 63 74 69 6f 6e 20 3d 3d |n..if (a|ction ==|
|00001930| 20 77 65 42 69 74 43 6c | 65 61 72 29 0d 09 7b 0d | weBitCl|ear)..{.|
|00001940| 09 09 42 43 4c 52 28 70 | 57 45 2d 3e 66 65 61 74 |..BCLR(p|WE->feat|
|00001950| 75 72 65 73 2c 20 66 65 | 61 74 75 72 65 29 3b 0d |ures, fe|ature);.|
|00001960| 09 7d 0d 09 65 6c 73 65 | 20 69 66 20 28 61 63 74 |.}..else| if (act|
|00001970| 69 6f 6e 20 3d 3d 20 77 | 65 42 69 74 53 65 74 29 |ion == w|eBitSet)|
|00001980| 0d 09 7b 0d 09 09 42 53 | 45 54 28 70 57 45 2d 3e |..{...BS|ET(pWE->|
|00001990| 66 65 61 74 75 72 65 73 | 2c 20 66 65 61 74 75 72 |features|, featur|
|000019a0| 65 29 3b 0d 09 7d 0d 0d | 09 2f 2f 20 72 65 74 75 |e);..}..|.// retu|
|000019b0| 72 6e 20 6f 6c 64 20 73 | 74 61 74 75 73 0d 09 72 |rn old s|tatus..r|
|000019c0| 65 74 75 72 6e 20 73 74 | 61 74 75 73 3b 0d 7d 0d |eturn st|atus;.}.|
|000019d0| 0d 70 61 73 63 61 6c 20 | 55 49 6e 74 33 32 20 57 |.pascal |UInt32 W|
|000019e0| 45 56 65 72 73 69 6f 6e | 28 76 6f 69 64 29 0d 7b |EVersion|(void).{|
|000019f0| 0d 09 72 65 74 75 72 6e | 20 57 41 53 54 45 5f 56 |..return| WASTE_V|
|00001a00| 45 52 53 49 4f 4e 20 3b | 0d 7d 0d 0d 70 61 73 63 |ERSION ;|.}..pasc|
|00001a10| 61 6c 20 4f 53 45 72 72 | 20 57 45 53 65 74 53 63 |al OSErr| WESetSc|
|00001a20| 61 6c 65 28 50 6f 69 6e | 74 20 6e 75 6d 65 72 2c |ale(Poin|t numer,|
|00001a30| 20 50 6f 69 6e 74 20 64 | 65 6e 6f 6d 2c 20 57 45 | Point d|enom, WE|
|00001a40| 48 61 6e 64 6c 65 20 68 | 57 45 29 0d 7b 0d 09 4f |Handle h|WE).{..O|
|00001a50| 53 45 72 72 20 65 72 72 | 20 3d 20 6e 6f 45 72 72 |SErr err| = noErr|
|00001a60| 3b 0d 0d 23 69 66 20 57 | 41 53 54 45 5f 53 43 41 |;..#if W|ASTE_SCA|
|00001a70| 4c 45 0d 09 69 66 20 28 | 28 2a 28 6c 6f 6e 67 2a |LE..if (|(*(long*|
|00001a80| 29 26 28 2a 68 57 45 29 | 2d 3e 73 63 61 6c 65 4e |)&(*hWE)|->scaleN|
|00001a90| 75 6d 65 72 20 21 3d 20 | 2a 28 6c 6f 6e 67 2a 29 |umer != |*(long*)|
|00001aa0| 26 6e 75 6d 65 72 29 20 | 7c 7c 0d 09 09 28 2a 28 |&numer) |||...(*(|
|00001ab0| 6c 6f 6e 67 2a 29 26 28 | 2a 68 57 45 29 2d 3e 73 |long*)&(|*hWE)->s|
|00001ac0| 63 61 6c 65 44 65 6e 6f | 6d 20 21 3d 20 2a 28 6c |caleDeno|m != *(l|
|00001ad0| 6f 6e 67 2a 29 26 64 65 | 6e 6f 6d 29 29 0d 09 7b |ong*)&de|nom))..{|
|00001ae0| 0d 09 09 28 2a 68 57 45 | 29 2d 3e 73 63 61 6c 65 |...(*hWE|)->scale|
|00001af0| 4e 75 6d 65 72 20 3d 20 | 6e 75 6d 65 72 3b 0d 09 |Numer = |numer;..|
|00001b00| 09 28 2a 68 57 45 29 2d | 3e 73 63 61 6c 65 44 65 |.(*hWE)-|>scaleDe|
|00001b10| 6e 6f 6d 20 3d 20 64 65 | 6e 6f 6d 3b 0d 0d 09 09 |nom = de|nom;....|
|00001b20| 5f 57 45 52 65 63 61 6c | 63 41 74 74 72 69 62 75 |_WERecal|cAttribu|
|00001b30| 74 65 73 28 68 57 45 29 | 3b 0d 0d 09 09 65 72 72 |tes(hWE)|;....err|
|00001b40| 20 3d 20 57 45 43 61 6c | 54 65 78 74 28 68 57 45 | = WECal|Text(hWE|
|00001b50| 29 3b 0d 23 69 66 20 21 | 57 41 53 54 45 5f 57 45 |);.#if !|WASTE_WE|
|00001b60| 43 41 4c 54 45 58 54 5f | 44 4f 45 53 5f 52 45 44 |CALTEXT_|DOES_RED|
|00001b70| 52 41 57 0d 09 09 69 66 | 20 28 21 65 72 72 29 0d |RAW...if| (!err).|
|00001b80| 09 09 09 65 72 72 20 3d | 20 5f 57 45 52 65 64 72 |...err =| _WERedr|
|00001b90| 61 77 28 30 2c 20 4c 4f | 4e 47 5f 4d 41 58 2c 20 |aw(0, LO|NG_MAX, |
|00001ba0| 68 57 45 29 3b 0d 23 65 | 6e 64 69 66 0d 09 7d 0d |hWE);.#e|ndif..}.|
|00001bb0| 23 65 6c 73 65 0d 23 70 | 72 61 67 6d 61 20 75 6e |#else.#p|ragma un|
|00001bc0| 75 73 65 64 20 28 6e 75 | 6d 65 72 2c 20 64 65 6e |used (nu|mer, den|
|00001bd0| 6f 6d 2c 20 68 57 45 29 | 0d 09 65 72 72 20 3d 20 |om, hWE)|..err = |
|00001be0| 70 61 72 61 6d 45 72 72 | 3b 0d 23 65 6e 64 69 66 |paramErr|;.#endif|
|00001bf0| 0d 0d 09 72 65 74 75 72 | 6e 20 65 72 72 3b 0d 7d |...retur|n err;.}|
|00001c00| 0d 0d 70 61 73 63 61 6c | 20 76 6f 69 64 20 57 45 |..pascal| void WE|
|00001c10| 47 65 74 53 63 61 6c 65 | 28 50 6f 69 6e 74 20 2a |GetScale|(Point *|
|00001c20| 6e 75 6d 65 72 2c 20 50 | 6f 69 6e 74 20 2a 64 65 |numer, P|oint *de|
|00001c30| 6e 6f 6d 2c 20 63 6f 6e | 73 74 20 57 45 48 61 6e |nom, con|st WEHan|
|00001c40| 64 6c 65 20 68 57 45 29 | 0d 7b 0d 23 69 66 20 57 |dle hWE)|.{.#if W|
|00001c50| 41 53 54 45 5f 53 43 41 | 4c 45 0d 09 2a 6e 75 6d |ASTE_SCA|LE..*num|
|00001c60| 65 72 20 3d 20 28 2a 68 | 57 45 29 2d 3e 73 63 61 |er = (*h|WE)->sca|
|00001c70| 6c 65 4e 75 6d 65 72 3b | 0d 09 2a 64 65 6e 6f 6d |leNumer;|..*denom|
|00001c80| 20 3d 20 28 2a 68 57 45 | 29 2d 3e 73 63 61 6c 65 | = (*hWE|)->scale|
|00001c90| 44 65 6e 6f 6d 3b 0d 23 | 65 6c 73 65 0d 09 2a 6e |Denom;.#|else..*n|
|00001ca0| 75 6d 65 72 20 3d 20 6b | 4f 6e 65 54 6f 4f 6e 65 |umer = k|OneToOne|
|00001cb0| 53 63 61 6c 69 6e 67 3b | 0d 09 2a 64 65 6e 6f 6d |Scaling;|..*denom|
|00001cc0| 20 3d 20 6b 4f 6e 65 54 | 6f 4f 6e 65 53 63 61 6c | = kOneT|oOneScal|
|00001cd0| 69 6e 67 3b 0d 23 65 6e | 64 69 66 0d 7d 0d 0d 00 |ing;.#en|dif.}...|
|00001ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d00| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00001d10| 00 d0 00 00 00 00 09 99 | 00 00 00 00 00 e0 00 00 |........|........|
|00001d20| 00 d0 00 00 00 09 99 99 | 99 00 00 00 00 e0 00 00 |........|........|
|00001d30| 0d 57 45 41 63 63 65 73 | 73 6f 72 73 2e 63 79 20 |.WEAcces|sors.cy |
|00001d40| 50 72 6f 6a 65 63 74 73 | 32 70 65 72 6f 6d 6c 6d |Projects|2peromlm|
|00001d50| 02 00 54 45 58 54 43 57 | 49 45 01 00 ff ff ff ff |..TEXTCW|IE......|
|00001d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d70| 00 00 ae 1e 99 ba 00 00 | 18 bf 00 00 01 ac 00 00 |........|........|
|00001d80| 00 d0 00 00 ff ff ff ff | ff ff f0 00 00 e0 00 00 |........|........|
|00001d90| 00 d0 00 00 00 00 00 00 | 00 00 00 00 00 e0 00 00 |........|........|
|00001da0| 00 d0 00 00 00 00 00 00 | 00 00 00 00 00 e0 00 00 |........|........|
|00001db0| 00 d0 00 00 00 00 00 00 | 00 00 00 00 00 e0 00 00 |........|........|
|00001dc0| 00 d0 00 00 00 00 00 00 | 00 00 00 00 00 e0 00 00 |........|........|
|00001dd0| 00 d0 00 00 00 00 00 00 | 00 00 00 00 00 e0 00 00 |........|........|
|00001de0| 00 d0 00 00 00 00 00 00 | 00 00 00 00 00 e0 00 00 |........|........|
|00001df0| 00 d0 00 00 00 00 00 00 | 00 00 00 00 00 e0 00 00 |........|........|
|00001e00| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00001e10| 07 9f d0 dc 03 66 00 00 | 00 1c 00 1e ff ff 00 00 |.....f..|........|
|00001e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+